
LOCAL_PATH    := $(call my-dir)
EXTERNAL_PATH := ../../../../../External
ENGINE_PATH   := ../../../../../Engine
UXSTL_PATH    := ../../../../../../../ux_stl/trunk
STD_PATH	  := $(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8
STDLIB_PATH   := $(STD_PATH)/libs/armeabi-v7a
#------------------------------------------------------------------------------


# Build UX-STL Core
include $(CLEAR_VARS)

MY_SOURCES  := ../../../Tests/Test_Android_Main.cpp

MY_INCLUDES := 

MY_LIBRARIES := \
	-L$(SYSROOT)/usr/lib \
	-ldl \
	-llog \
	-landroid
	
MY_C_FLAGS := \
	-std=c++11 \
	-fno-rtti \
	-Werror=return-type \
	-Werror=sequence-point \
	-Werror=char-subscripts \
	-Werror=switch \
	-Werror=switch-enum \
	-Werror=missing-braces \
	-Werror=missing-include-dirs \
	-Werror=parentheses \
	-Werror=unknown-pragmas \
	-Werror=enum-compare \
	-Werror=sizeof-pointer-memaccess \
	-Werror=address \
	-Werror=sign-compare \
	-Wunused \
	-Wuninitialized \
	-Wfloat-equal \
	-Wvolatile-register-var \
	-Wignored-qualifiers \
	-Wtype-limits \
	-D__UX_BUILD_STATIC_LIB__ \
	-D__UX_BUILD__ \
	-D__UX_STL_UNIT_TEST__
	
# options
#	-Wunused-function \
	-Wunused-but-set-variable \
	-Wunused-but-set-parameter \
	-Wunused-local-typedefs \
	-Wunused-variable \
	or \
	-Wunused \
	
MY_FLAGS_RELEASE := \
	-fvisibility=hidden \
	-finline-functions-called-once \
	-fdata-sections \
	-ffunction-sections \
	-ffast-math \
	-funroll-loops \
	-fno-stack-protector \
	-O3 \
	-flto \
	-DNDEBUG

MY_FLAGS_DEBUG := \
	-D__UX_DEBUG__ \
	-D_DEBUG \
	-g \
	-pipe \
	-Warray-bounds


LOCAL_MODULE    := UXSTL

LOCAL_CFLAGS     += $(MY_C_FLAGS)
LOCAL_C_INCLUDES := $(MY_INCLUDES)
LOCAL_SRC_FILES  := $(MY_SOURCES)
LOCAL_LDLIBS     := $(MY_LIBRARIES)


ifeq ($(NDK_DEBUG), 1)
	LOCAL_CFLAGS   += $(MY_FLAGS_DEBUG)
else
	LOCAL_CFLAGS   += $(MY_FLAGS_RELEASE)
endif

	
# LOCAL_STATIC_LIBRARIES := $(MY_STATIC_LIBS)

include $(BUILD_SHARED_LIBRARY)
#------------------------------------------------------------------------------

